﻿using System;
using DomainModel;
using Services.Abstract;

namespace Services.Concrete
{
    public class WorkTypeService : IWorkTypeService
    {
        public string GetWorkTypeName(WorkType workType)
        {
            switch (workType)
            {
                case WorkType.Lection:
                    return "Лекция";
                case WorkType.Lab:
                    return "Лабораторная";
                case WorkType.Practical:
                    return "Практическое";
                case WorkType.Consultation:
                    return "Консультация";
                default:
                    throw new Exception("Invalid worktype.");
            }
        }

        public WorkType GetWorkTypeByName(string workTypeName)
        {
            switch (workTypeName)
            {
                case "Лекция":
                    return WorkType.Lection;
                case "Лабораторная":
                    return WorkType.Lab;
                case "Практическое":
                    return WorkType.Practical;
                case "Консультация":
                    return WorkType.Consultation;
                default:
                    throw new Exception("Invalid worktype name.");
            }
        }
    }
}